package com.edu.study.base.stuQuestionOption.service.impl;

import com.edu.study.base.stuQuestionOption.domain.StuQuestionOption;
import com.edu.study.base.stuQuestionOption.mapper.StuQuestionOptionMapper;
import com.edu.study.base.stuQuestionOption.service.IStuQuestionOptionService;
import com.ruoyi.common.annotation.DataSource;
import com.ruoyi.common.enums.DataSourceType;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 试题选项内容Service业务层处理
 *
 * @author jjt
 * @date 2021-04-02
 */
@Service
//@DataSource(value = DataSourceType.SLAVE)
public class StuQuestionOptionServiceImpl implements IStuQuestionOptionService
{
    @Autowired
    private StuQuestionOptionMapper stuQuestionOptionMapper;

    /**
     * 查询试题选项内容
     *
     * @param id 试题选项内容ID
     * @return 试题选项内容
     */
    @Override
    public StuQuestionOption selectStuQuestionOptionById(Long id)
    {
        return stuQuestionOptionMapper.selectStuQuestionOptionById(id);
    }

    /**
     * 查询试题选项内容列表
     *
     * @param stuQuestionOption 试题选项内容
     * @return 试题选项内容
     */
    @Override
    public List<StuQuestionOption> selectStuQuestionOptionList(StuQuestionOption stuQuestionOption)
    {
        return stuQuestionOptionMapper.selectStuQuestionOptionList(stuQuestionOption);
    }

    @Override
    public List<StuQuestionOption> selectStuQuestionOptionListByIds(List<Long> ids) {
        return stuQuestionOptionMapper.selectStuQuestionOptionListByIds(ids);
    }

    /**
     * 新增试题选项内容
     *
     * @param stuQuestionOption 试题选项内容
     * @return 结果
     */
    @Override
    public int insertStuQuestionOption(StuQuestionOption stuQuestionOption)
    {
        return stuQuestionOptionMapper.insertStuQuestionOption(stuQuestionOption);
    }

    /**
     * 修改试题选项内容
     *
     * @param stuQuestionOption 试题选项内容
     * @return 结果
     */
    @Override
    public int updateStuQuestionOption(StuQuestionOption stuQuestionOption)
    {
        return stuQuestionOptionMapper.updateStuQuestionOption(stuQuestionOption);
    }

    /**
     * 批量删除试题选项内容
     *
     * @param ids 需要删除的试题选项内容ID
     * @return 结果
     */
    @Override
    public int deleteStuQuestionOptionByIds(String[] ids)
    {
        return stuQuestionOptionMapper.deleteStuQuestionOptionByIds(ids);
    }

    /**
     * 删除试题选项内容信息
     *
     * @param id 试题选项内容ID
     * @return 结果
     */
    @Override
    public int deleteStuQuestionOptionById(String id)
    {
        return stuQuestionOptionMapper.deleteStuQuestionOptionById(id);
    }
}
